﻿using SheepStorage.Domain.Entity;
using SheepStorage.Repository.Interface;
using SheepStorage.Service.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SheepStorage.Service.DataImp
{
    /// <summary>
    /// 省份服务实现
    /// </summary>
    public class ProvinceService : IProvinceService
    {

        /// <summary>
        /// 省份仓储
        /// </summary>
        private readonly IBaseRepository<Province> repository;

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="repository">省份仓储</param>
        public ProvinceService(IBaseRepository<Province> repository)
        {
            this.repository = repository;
        }

        /// <summary>
        /// 获得所有省份
        /// </summary>
        /// <returns></returns>
        public async Task<List<Province>> GetProvinces()
        {
            return repository.GetAll().ToList();
        }
    }
}
